import request from './request'

export function getUserList(parameters){
  return request({
    url: '/users',
    method: 'GET',
    params: parameters
  })
}
export function addUser(data){
  return request({
    url:'/users',
    method:'POST',
    data:data
  })
}
export function changeUserState(userId,type){
  return request({
    url: `/users/${userId}/state/${type}`,
    method: 'PUT'
  })
}

export function editUser(userId, email, mobile){
  return request({
    url: `/users/${userId}`,
    method: 'PUT',
    data: {
      email: email,
      mobile: mobile,
    }
  })
}

export function setUser(userId, rId){
  return request({
    url: `/users/${userId}/role`,
    method: 'PUT',
    data: {
      rid: rId
    }
  })
}
export function delUser(userid){
  return request({
    url: `/users/${userid}`,
    method: 'DELETE'
  })
}